home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’92 / PatchWorks Kit / <PatchWorks++> / VirtualWorld.h < prev   
Text File  |  1992-04-27  |  922b  |  39 lines

  1. /*
  2.     VirtualWorld.h
  3.     
  4.     Interface to the Virtual world maintaining class.
  5.     
  6.     by Patrick Beard.
  7.     
  8.     ©1990, 91, 92 by Patrick C. Beard.  All rights reserved.
  9.  */
  10.  
  11. #pragma once
  12.  
  13. #ifndef __VIRTUAL_WORLD__
  14. #define __VIRTUAL_WORLD__
  15.  
  16. #include <Memory.h>
  17. #include <stddef.h>
  18.  
  19. class VirtualWorld {
  20. public:
  21.     VirtualWorld(Boolean worldFloats);    // constructor sets up world.
  22.     ~VirtualWorld();                    // destructor destroys it.
  23.     
  24.     // main functions, Enter sets A5 to point to our world.
  25.     void* Enter();                        // go into our world.
  26.     void Leave(void* oldA5);            // restore old world.
  27.     
  28. private:
  29.     Boolean itsFloating;                // whether we have to call the vtable init.
  30.     char* itsWorld;                        // the storage for the virtual world.
  31.     long itsSize;                        // how big our globals are.
  32.     void* itsA5;                        // the computed value of A5 to use.
  33. };
  34.  
  35. void* operator new(size_t n);            // handle our own new & delete operators.
  36. void operator delete(void* p);
  37.  
  38. #endif
  39.